<template>
  <nav-bar class="cart-nav-bar">
    <div slot="center">购物车({{productCount}})</div>
  </nav-bar>
</template>

<script>
  import NavBar from 'components/common/navbar/NavBar'

export default {
  name:'CartNav',
  components:{
    NavBar
  },
  computed:{
    productCount(){
      return this.$store.state.cartList.length
    }
  }
}
</script>

<style scoped>

.cart-nav-bar {
  background-color: var(--color-tint);
  color: #fff;
}
  
</style>